<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>    
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>
<body>
    <div id="app">
        <!-- v-bind  当做表达式解析 -->

        <!-- Invalid prop: type check failed for prop "price" -->
        <!-- <my-book name="西游记" price="5"></my-book> -->
        <!-- <my-book name="西游记" :price="5"></my-book> -->
        <!-- :动态绑定 "5" "true" 会解析成number 和boolean-->
        <my-book :name="'西游记'" :price="5" :is-Published="true" :read-list="['你','好']" :obj="{}"></my-book>
    </div>
    
    <script>
        Vue.component("my-book",{
            props:{
                name:String,
                price:Number,
                isPublished:Boolean,
                readList:Array
            },
            template:`
            <div>
                <p>{{name}}</p>
                <p>{{price}}</p>
                <p>{{isPublished?"出版了":"未出版"}}</p>
                <p v-for="item in readList">{{item}}</p>
            </div>
            
            `
        })

        new Vue({
            el:"#app",
            data:{
              
            }
        });
    
    </script>
</body>
</html>